<template>
  <div class="app-container">
    <el-form ref="form" :model="department" :rules="rules" label-width="auto">
      <el-form-item label="自动派单">
        <el-switch v-model="department.orderAllocationState" active-value="1" inactive-value="0" @change="change">
        </el-switch>
      </el-form-item>
    </el-form>
    <div class="tips">
      <p>1、新增验房/打扫信息后，系统按保洁人员的职责范围自动派单</p>
      <p>2、采用随机模式派单，优先给当天没有验房/打扫的保洁人员进行派单</p>
      <p>3、楼盘没有安排保洁人员，系统不会进行自动派单</p>
    </div>
  </div>
</template>

<script>
import { getDepartment,editOrderAllocationState } from '@/api/houseCleaning/dispatchRule';
export default {
  name: "Index",
  dicts: [],
  components: {},
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 总条数
      total: 0,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      department:{},
      form: {
        orderAllocationState: '1'
      },
      rules: {},
    };
  },
  watch: {
  },
  created() {
    this.getDepartment()
  },
  methods: {
    getDepartment(){
      getDepartment().then(res=>{
        this.department = res.data
      })
    },
    change(){
      editOrderAllocationState().then(res=>{
        this.getDepartment()
      })
    },
  }
};
</script>

<style lang="scss" scoped></style>
